﻿using Microsoft.AspNetCore.Mvc;

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;

using Wms.Manager.Common.Dtos;
using Wms.Manager.Wms.InventoryManagements.Dtos;

namespace Wms.Manager.Wms.InventoryManagements
{
    public interface IInventoryManagementAppService : IApplicationService
    {
        /// <summary>
        /// 获取库存分页列表
        /// </summary>
        Task<PagedResultDto<InventoryManagementDto>> GetListAsync(InventoryManagementFilterDto input);

        /// <summary>
        /// 根据ID获取单个库存
        /// </summary>
        Task<InventoryManagementDto> GetAsync(Guid id);

        /// <summary>
        /// 创建库存
        /// </summary>
        Task<InventoryManagementDto> CreateAsync(CreateInventoryManagementDto input);

        Task InsertManyAsync(List<InventoryManagementImportExportDto> data);

        /// <summary>
        /// 更新库存
        /// </summary>
        Task<InventoryManagementDto> UpdateAsync(Guid id, UpdateInventoryManagementDto input);

        /// <summary>
        /// 删除库存
        /// </summary>
        Task DeleteAsync(Guid id);

        /// <summary>
        /// 批量删除库存记录
        /// </summary>
        Task DeleteAsync(IEnumerable<Guid> ids);

        /// <summary>
        /// 导出
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [ApiExplorerSettings(IgnoreApi = true)] // 排除该方法
        Task<byte[]> ExportInventoryAsync(List<Guid> ids = null);

        /// <summary>
        /// 导出模板
        /// </summary>
        /// <returns></returns>
        [ApiExplorerSettings(IgnoreApi = true)]
        Task<byte[]> ExportTemplateAsync();

        /// <summary>
        /// 导入验证
        /// </summary>
        /// <param name="fileStream"></param>
        /// <returns></returns>
        [ApiExplorerSettings(IgnoreApi = true)]
        [DisableValidation]
        Task<ImportResult<InventoryManagementImportExportDto>> ImportInventoryAsync(Stream fileStream);
    }
}
